﻿using Microsoft.AspNetCore.Razor.TagHelpers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace MvcSample.TagHelpers
{
    /// <summary>
    /// Condition tag helper.
    /// </summary>
    [HtmlTargetElement(Attributes ="asp-condition")]
    public class ConditionTagHelper
        : TagHelper
    {
        public bool Condition { get; set; }
        public override void Process(TagHelperContext context, TagHelperOutput output)
        {
            if (!Condition)
            {
                output.SuppressOutput();
            }
        }
    }
}
